//
//  RateView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/4.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "RateView.h"
#import <Masonry.h>
@implementation RateView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    self.swipeRateView = [[UIView alloc] init];
    self.swipeRateView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.swipeRateView];
    [self.swipeRateView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.equalTo(self).multipliedBy(0.3);
        make.top.mas_equalTo(10);
    }];
    
    self.swipeRateLab = [[UILabel alloc] init];
    self.swipeRateLab.text = @"刷卡费率";
    self.swipeRateLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.swipeRateLab.font = [UIFont boldSystemFontOfSize:14.0];
    [self.swipeRateView addSubview: self.swipeRateLab];
    [self.swipeRateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(20);
    }];
    
    self.swipeRateLineView = [[UIView alloc] init];
    self.swipeRateLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
    [self.swipeRateView addSubview:self.swipeRateLineView];
    [self.swipeRateLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.swipeRateLab.mas_bottom).offset(10);
        make.height.mas_equalTo(1);
    }];
    
    
    self.swipeRateListView = [[UIView alloc] init];
    [self.swipeRateView addSubview:self.swipeRateListView];
    [self.swipeRateListView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.swipeRateLineView);
        make.bottom.equalTo(self.swipeRateView.mas_bottom);
    }];
    
    
    self.swipeRateCategoryLab = [[MYLabel alloc] init];
    self.swipeRateCategoryLab.text = @"卡类型";
    [self.swipeRateCategoryLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.swipeRateCategoryLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateCategoryLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateCategoryLab];
    
    self.swipeRateMorrowLab = [[MYLabel alloc] init];
    self.swipeRateMorrowLab.text = @"标准费率\n(次日到账)";
    self.swipeRateMorrowLab.numberOfLines = 0;
    [self.swipeRateMorrowLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.swipeRateMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateMorrowLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateMorrowLab];
    
    self.swipeRateCurrentLab = [[MYLabel alloc] init];
    self.swipeRateCurrentLab.text = @"标准费率\n(立即到账)";
    self.swipeRateCurrentLab.numberOfLines = 0;
    [self.swipeRateCurrentLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.swipeRateCurrentLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateCurrentLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateCurrentLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateCurrentLab];
    
    self.swipeRateWithdrawLab = [[MYLabel alloc] init];
    self.swipeRateWithdrawLab.text = @"提现手续费";
    [self.swipeRateWithdrawLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.swipeRateWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateWithdrawLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateWithdrawLab];
    
    NSMutableArray *array = [NSMutableArray array];
    [array addObject:self.swipeRateCategoryLab];
    [array addObject:self.swipeRateMorrowLab];
    [array addObject:self.swipeRateCurrentLab];
    [array addObject:self.swipeRateWithdrawLab];
    
    [array mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [array mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.swipeRateCategoryLab);
        make.height.equalTo(self.swipeRateCategoryLab);
    }];
    
    
    self.swipeRateDebitCardLab = [[UILabel alloc] init];
    self.swipeRateDebitCardLab.text = @"借记卡";
    self.swipeRateDebitCardLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateDebitCardLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateDebitCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateDebitCardLab];
    
    self.swipeRateDebitCardsMorrowLab = [[UILabel alloc] init];
    self.swipeRateDebitCardsMorrowLab.text = @"2%";
    self.swipeRateDebitCardsMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateDebitCardsMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateDebitCardsMorrowLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateDebitCardsMorrowLab];
    
    self.swipeRateDebitCardCurrentLimitLab = [[UILabel alloc] init];
    self.swipeRateDebitCardCurrentLimitLab.text = @"3%";
    self.swipeRateDebitCardCurrentLimitLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateDebitCardCurrentLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateDebitCardCurrentLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateDebitCardCurrentLimitLab];
    
    self.swipeRateDebitCardWithdrawLab = [[UILabel alloc] init];
    self.swipeRateDebitCardWithdrawLab.text = @"0.6";
    self.swipeRateDebitCardWithdrawLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateDebitCardWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateDebitCardWithdrawLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateDebitCardWithdrawLab];
    
    NSMutableArray *debitArray = [NSMutableArray array];
    [debitArray addObject:self.swipeRateDebitCardLab];
    [debitArray addObject:self.swipeRateDebitCardsMorrowLab];
    [debitArray addObject:self.swipeRateDebitCardCurrentLimitLab];
    [debitArray addObject:self.swipeRateDebitCardWithdrawLab];
    
    [debitArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [debitArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.swipeRateDebitCardLab);
    }];
    
    self.swipeRateCreditCardLab = [[UILabel alloc] init];
    self.swipeRateCreditCardLab.text = @"信用卡";
    self.swipeRateCreditCardLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateCreditCardLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateCreditCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateCreditCardLab];
    
    self.swipeRateCreditCardMorrowLab = [[UILabel alloc] init];
    self.swipeRateCreditCardMorrowLab.text = @"2%";
    self.swipeRateCreditCardMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateCreditCardMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateCreditCardMorrowLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateCreditCardMorrowLab];
    
    self.swipeRateCreditCardCurrentLab = [[UILabel alloc] init];
    self.swipeRateCreditCardCurrentLab.text = @"3%";
    self.swipeRateCreditCardCurrentLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateCreditCardCurrentLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateCreditCardCurrentLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateCreditCardCurrentLab];
    
    self.swipeRateCreditCardWithdrawLab = [[UILabel alloc] init];
    self.swipeRateCreditCardWithdrawLab.text = @"0.9";
    self.swipeRateCreditCardWithdrawLab.textAlignment = NSTextAlignmentCenter;
    self.swipeRateCreditCardWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.swipeRateCreditCardWithdrawLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.swipeRateListView addSubview:self.swipeRateCreditCardWithdrawLab];
    
    NSMutableArray *creditArray = [NSMutableArray array];
    [creditArray addObject:self.swipeRateCreditCardLab];
    [creditArray addObject:self.swipeRateCreditCardMorrowLab];
    [creditArray addObject:self.swipeRateCreditCardCurrentLab];
    [creditArray addObject:self.swipeRateCreditCardWithdrawLab];
    
    [creditArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [creditArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.swipeRateCreditCardLab);
    }];
    
    //竖向排列
    
    NSMutableArray *swipeVerticalArray = [NSMutableArray array];
    [swipeVerticalArray addObject:self.swipeRateCategoryLab];
    [swipeVerticalArray addObject:self.swipeRateDebitCardLab];
    [swipeVerticalArray addObject:self.swipeRateCreditCardLab];
    
    [swipeVerticalArray mas_distributeViewsAlongAxis:(MASAxisTypeVertical) withFixedSpacing:0 leadSpacing:10 tailSpacing:0];
    
    
    //信用卡收款费率
    self.CreditReceiptRateView = [[UIView alloc] init];
    self.CreditReceiptRateView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.CreditReceiptRateView];
    [self.CreditReceiptRateView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.equalTo(self).multipliedBy(0.30);
        make.top.equalTo(self.swipeRateView.mas_bottom).offset(10);;
    }];
    
    self.CreditReceiptRateLab = [[UILabel alloc] init];
    self.CreditReceiptRateLab.text = @"信用卡收款费率";
    self.CreditReceiptRateLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.CreditReceiptRateLab.font = [UIFont boldSystemFontOfSize:14.0];
    [self.CreditReceiptRateView addSubview: self.CreditReceiptRateLab];
    [self.CreditReceiptRateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(20);
    }];
    
    self.CreditReceiptRateLineView = [[UIView alloc] init];
    self.CreditReceiptRateLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
    [self.CreditReceiptRateView addSubview:self.CreditReceiptRateLineView];
    [self.CreditReceiptRateLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
//        make.top.equalTo(self.CreditReceiptRateLab.mas_bottom).offset(10);
        make.top.mas_equalTo(40);
        make.height.mas_equalTo(1);
    }];
    
    
    self.CreditReceiptRateListView = [[UIView alloc] init];
    [self.CreditReceiptRateView addSubview:self.CreditReceiptRateListView];
    [self.CreditReceiptRateListView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.CreditReceiptRateLineView);
        make.bottom.equalTo(self.CreditReceiptRateView.mas_bottom);
    }];
    
    
    self.CreditReceiptCategoryLab = [[MYLabel alloc] init];
    self.CreditReceiptCategoryLab.text = @"卡类型";
    [self.CreditReceiptCategoryLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.CreditReceiptCategoryLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditReceiptCategoryLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditReceiptCategoryLab];
    
    self.CreditReceiptRateMorrowLab = [[MYLabel alloc] init];
    self.CreditReceiptRateMorrowLab.text = @"标准费率\n(次日到账)";
    self.CreditReceiptRateMorrowLab.numberOfLines = 0;
    [self.CreditReceiptRateMorrowLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.CreditReceiptRateMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.CreditReceiptRateMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditReceiptRateMorrowLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditReceiptRateMorrowLab];
    
    self.CreditReceiptRateCurrentLab = [[MYLabel alloc] init];
    self.CreditReceiptRateCurrentLab.text = @"标准费率\n(立即到账)";
    self.CreditReceiptRateCurrentLab.numberOfLines = 0;
    [self.CreditReceiptRateCurrentLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.CreditReceiptRateCurrentLab.textAlignment = NSTextAlignmentCenter;
    self.CreditReceiptRateCurrentLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditReceiptRateCurrentLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditReceiptRateCurrentLab];
    
    self.CreditReceiptRateWithdrawLab = [[MYLabel alloc] init];
    self.CreditReceiptRateWithdrawLab.text = @"提现手续费";
    [self.CreditReceiptRateWithdrawLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.CreditReceiptRateWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditReceiptRateWithdrawLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditReceiptRateWithdrawLab];
    
    NSMutableArray *CategoryArray = [NSMutableArray array];
    [CategoryArray addObject:self.CreditReceiptCategoryLab];
    [CategoryArray addObject:self.CreditReceiptRateMorrowLab];
    [CategoryArray addObject:self.CreditReceiptRateCurrentLab];
    [CategoryArray addObject:self.CreditReceiptRateWithdrawLab];
    
    [CategoryArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [CategoryArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.CreditReceiptCategoryLab);
        make.height.equalTo(self.CreditReceiptCategoryLab);
    }];
    
    
    
    
    self.CreditRateDebitCardLab = [[UILabel alloc] init];
    self.CreditRateDebitCardLab.text = @"借记卡";
    self.CreditRateDebitCardLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateDebitCardLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateDebitCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateDebitCardLab];
    
    self.CreditRateDebitCardsMorrowLab = [[UILabel alloc] init];
    self.CreditRateDebitCardsMorrowLab.text = @"2%";
    self.CreditRateDebitCardsMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateDebitCardsMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateDebitCardsMorrowLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateDebitCardsMorrowLab];
    
    self.CreditRateDebitCardCurrentLimitLab = [[UILabel alloc] init];
    self.CreditRateDebitCardCurrentLimitLab.text = @"3%";
    self.CreditRateDebitCardCurrentLimitLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateDebitCardCurrentLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateDebitCardCurrentLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateDebitCardCurrentLimitLab];
    
    self.CreditRateDebitCardWithdrawLab = [[UILabel alloc] init];
    self.CreditRateDebitCardWithdrawLab.text = @"0.6";
    self.CreditRateDebitCardWithdrawLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateDebitCardWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateDebitCardWithdrawLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateDebitCardWithdrawLab];
    
    NSMutableArray *CredictDebitArray = [NSMutableArray array];
    [CredictDebitArray addObject:self.CreditRateDebitCardLab];
    [CredictDebitArray addObject:self.CreditRateDebitCardsMorrowLab];
    [CredictDebitArray addObject:self.CreditRateDebitCardCurrentLimitLab];
    [CredictDebitArray addObject:self.CreditRateDebitCardWithdrawLab];
    
    [CredictDebitArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [CredictDebitArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.CreditRateDebitCardLab);
    }];

    
    self.CreditRateCreditCardLab = [[UILabel alloc] init];
    self.CreditRateCreditCardLab.text = @"信用卡";
    self.CreditRateCreditCardLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateCreditCardLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateCreditCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateCreditCardLab];
    
    self.CreditRateCreditCardMorrowLab = [[UILabel alloc] init];
    self.CreditRateCreditCardMorrowLab.text = @"2%";
    self.CreditRateCreditCardMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateCreditCardMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateCreditCardMorrowLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateCreditCardMorrowLab];
    
    self.CreditRateCreditCardCurrentLab = [[UILabel alloc] init];
    self.CreditRateCreditCardCurrentLab.text = @"3%";
    self.CreditRateCreditCardCurrentLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateCreditCardCurrentLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateCreditCardCurrentLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateCreditCardCurrentLab];
    
    self.CreditRateCreditCardWithdrawLab = [[UILabel alloc] init];
    self.CreditRateCreditCardWithdrawLab.text = @"0.9";
    self.CreditRateCreditCardWithdrawLab.textAlignment = NSTextAlignmentCenter;
    self.CreditRateCreditCardWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.CreditRateCreditCardWithdrawLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.CreditReceiptRateListView addSubview:self.CreditRateCreditCardWithdrawLab];
    
    NSMutableArray *creditCreditArray = [NSMutableArray array];
    [creditCreditArray addObject:self.CreditRateCreditCardLab];
    [creditCreditArray addObject:self.CreditRateCreditCardMorrowLab];
    [creditCreditArray addObject:self.CreditRateCreditCardCurrentLab];
    [creditCreditArray addObject:self.CreditRateCreditCardWithdrawLab];
    
    [creditCreditArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [creditCreditArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.CreditRateCreditCardLab);
    }];
    
    
    //竖向排列
    
    NSMutableArray *crredictSwipeVerticalArray = [NSMutableArray array];
    [crredictSwipeVerticalArray addObject:self.CreditReceiptCategoryLab];
    [crredictSwipeVerticalArray addObject:self.CreditRateDebitCardLab];
    [crredictSwipeVerticalArray addObject:self.CreditRateCreditCardLab];
    
    [crredictSwipeVerticalArray mas_distributeViewsAlongAxis:(MASAxisTypeVertical) withFixedSpacing:0 leadSpacing:10 tailSpacing:0];
    
    
    //银联收款费率
    self.unipayRateView = [[UIView alloc] init];
    self.unipayRateView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.unipayRateView];
    [self.unipayRateView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.equalTo(self).multipliedBy(0.3);
        make.top.equalTo(self.CreditReceiptRateView.mas_bottom).offset(10);
    }];
    
    self.unipayRateLab = [[UILabel alloc] init];
    self.unipayRateLab.text = @"银联收款费率";
    self.unipayRateLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    self.unipayRateLab.font = [UIFont boldSystemFontOfSize:14.0];
    [self.unipayRateView addSubview: self.unipayRateLab];
    [self.unipayRateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(10);
        make.height.mas_equalTo(20);
    }];
    
    self.unipayRateLineView = [[UIView alloc] init];
    self.unipayRateLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
    [self.unipayRateView addSubview:self.unipayRateLineView];
    [self.unipayRateLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.unipayRateLab.mas_bottom).offset(10);
        make.height.mas_equalTo(1);
    }];
    
    
    self.unipayRateListView = [[UIView alloc] init];
    [self.unipayRateView addSubview:self.unipayRateListView];
    [self.unipayRateListView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.unipayRateLineView);
        make.bottom.equalTo(self.unipayRateView.mas_bottom);
    }];
    
    
    self.unipayRateCategoryLab = [[MYLabel alloc] init];
    self.unipayRateCategoryLab.text = @"卡类型";
    [self.unipayRateCategoryLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.unipayRateCategoryLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateCategoryLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateCategoryLab];
    
    self.unipayRateRateMorrowLab = [[MYLabel alloc] init];
    self.unipayRateRateMorrowLab.text = @"标准费率\n(次日到账)";
    self.unipayRateRateMorrowLab.numberOfLines = 0;
    [self.unipayRateRateMorrowLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.unipayRateRateMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateRateMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateRateMorrowLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateRateMorrowLab];
    
    self.unipayRateRateCurrentLab = [[MYLabel alloc] init];
    self.unipayRateRateCurrentLab.text = @"标准费率\n(立即到账)";
    self.unipayRateRateCurrentLab.numberOfLines = 0;
    [self.unipayRateRateCurrentLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.unipayRateRateCurrentLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateRateCurrentLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateRateCurrentLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateRateCurrentLab];
    
    self.unipayRateRateWithdrawLab = [[MYLabel alloc] init];
    self.unipayRateRateWithdrawLab.text = @"提现手续费";
    [self.unipayRateRateWithdrawLab setVerticalAlignment:(VerticalAlignmentTop)];
    self.unipayRateRateWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateRateWithdrawLab.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateRateWithdrawLab];
    
    NSMutableArray *unipayCategoryarray = [NSMutableArray array];
    [unipayCategoryarray addObject:self.unipayRateCategoryLab];
    [unipayCategoryarray addObject:self.unipayRateRateMorrowLab];
    [unipayCategoryarray addObject:self.unipayRateRateCurrentLab];
    [unipayCategoryarray addObject:self.unipayRateRateWithdrawLab];
    
    [unipayCategoryarray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [unipayCategoryarray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.unipayRateCategoryLab);
        make.height.equalTo(self.unipayRateCategoryLab);
    }];
    
    
    self.unipayRateDebitCardLab = [[UILabel alloc] init];
    self.unipayRateDebitCardLab.text = @"借记卡";
    self.unipayRateDebitCardLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateDebitCardLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateDebitCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateDebitCardLab];
    
    self.unipayRateDebitCardsMorrowLab = [[UILabel alloc] init];
    self.unipayRateDebitCardsMorrowLab.text = @"2%";
    self.unipayRateDebitCardsMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateDebitCardsMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateDebitCardsMorrowLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateDebitCardsMorrowLab];
    
    self.unipayRateDebitCardCurrentLimitLab = [[UILabel alloc] init];
    self.unipayRateDebitCardCurrentLimitLab.text = @"3%";
    self.unipayRateDebitCardCurrentLimitLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateDebitCardCurrentLimitLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateDebitCardCurrentLimitLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateDebitCardCurrentLimitLab];
    
    self.unipayRateDebitCardWithdrawLab = [[UILabel alloc] init];
    self.unipayRateDebitCardWithdrawLab.text = @"0.6";
    self.unipayRateDebitCardWithdrawLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateDebitCardWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateDebitCardWithdrawLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateDebitCardWithdrawLab];
    
    NSMutableArray *unipayCredictDebitArray = [NSMutableArray array];
    [unipayCredictDebitArray addObject:self.unipayRateDebitCardLab];
    [unipayCredictDebitArray addObject:self.unipayRateDebitCardsMorrowLab];
    [unipayCredictDebitArray addObject:self.unipayRateDebitCardCurrentLimitLab];
    [unipayCredictDebitArray addObject:self.unipayRateDebitCardWithdrawLab];
    
    [unipayCredictDebitArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [unipayCredictDebitArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.unipayRateDebitCardLab);
    }];
    
    self.unipayRateCreditCardLab = [[UILabel alloc] init];
    self.unipayRateCreditCardLab.text = @"信用卡";
    self.unipayRateCreditCardLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateCreditCardLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateCreditCardLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateCreditCardLab];
    
    self.unipayRateCreditCardMorrowLab = [[UILabel alloc] init];
    self.unipayRateCreditCardMorrowLab.text = @"2%";
    self.unipayRateCreditCardMorrowLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateCreditCardMorrowLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateCreditCardMorrowLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateCreditCardMorrowLab];
    
    self.unipayRateCreditCardCurrentLab = [[UILabel alloc] init];
    self.unipayRateCreditCardCurrentLab.text = @"3%";
    self.unipayRateCreditCardCurrentLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateCreditCardCurrentLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateCreditCardCurrentLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateCreditCardCurrentLab];
    
    self.unipayRateCreditCardWithdrawLab = [[UILabel alloc] init];
    self.unipayRateCreditCardWithdrawLab.text = @"0.9";
    self.unipayRateCreditCardWithdrawLab.textAlignment = NSTextAlignmentCenter;
    self.unipayRateCreditCardWithdrawLab.font = [UIFont systemFontOfSize:13.0];
    self.unipayRateCreditCardWithdrawLab.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    [self.unipayRateListView addSubview:self.unipayRateCreditCardWithdrawLab];
    
    NSMutableArray *uniapyCreditArray = [NSMutableArray array];
    [uniapyCreditArray addObject:self.unipayRateCreditCardLab];
    [uniapyCreditArray addObject:self.unipayRateCreditCardMorrowLab];
    [uniapyCreditArray addObject:self.unipayRateCreditCardCurrentLab];
    [uniapyCreditArray addObject:self.unipayRateCreditCardWithdrawLab];
    
    [uniapyCreditArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:0 leadSpacing:0 tailSpacing:0];
    [uniapyCreditArray mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.unipayRateCreditCardLab);
    }];
    
    
    //竖向排列
    
    NSMutableArray *unipayVerticalArray = [NSMutableArray array];
    [unipayVerticalArray addObject:self.unipayRateCategoryLab];
    [unipayVerticalArray addObject:self.unipayRateDebitCardLab];
    [unipayVerticalArray addObject:self.unipayRateCreditCardLab];
    
    [unipayVerticalArray mas_distributeViewsAlongAxis:(MASAxisTypeVertical) withFixedSpacing:0 leadSpacing:10 tailSpacing:0];
}

@end
